accounts-qt  1.16
Provider Class Reference

Representation of an account provider. More...

#include <Accounts/Provider>

Public Member Functions

 Provider ()
 Construct an invalid provider.
 
 Provider (const Provider &other)
 Copy constructor. More...
 
Provideroperator= (const Provider &other)
 
bool isValid () const
 Check whether this object represents a Provider. More...
 
QString name () const
 Get the name of the provider. More...
 
QString displayName () const
 Get the display name of the provider, untranslated. More...
 
QString description () const
 Get the description of the provider, untranslated. More...
 
QString pluginName () const
 Get the name of the account plugin associated with the provider. More...
 
QString trCatalog () const
 
QString iconName () const
 
QString domainsRegExp () const
 
bool isSingleAccount () const
 
bool hasTag (const QString &tag) const
 Check if this provider has a tag. More...
 
QSet< QString > tags () const
 Return all tags of the provider as a set. More...
 
const QDomDocument domDocument () const
 

Friends

bool operator== (const Accounts::Provider &p1, const Accounts::Provider &p2)
 

Detailed Description

Representation of an account provider.

The Provider object represents an account provider. It can be used to retrieve some basic properties of the provider (such as the name) and to get access to the contents of the XML file which defines it.

Definition at line 48 of file provider.h.

Constructor & Destructor Documentation

◆ Provider()

Provider ( const Provider other)

Copy constructor.

Copying a Provider object is very cheap, because the data is shared among copies.

Definition at line 67 of file provider.cpp.

Member Function Documentation

◆ description()

QString description ( ) const

Get the description of the provider, untranslated.

Returns
The description of the provider.

Definition at line 131 of file provider.cpp.

◆ displayName()

QString displayName ( ) const

Get the display name of the provider, untranslated.

Returns
The display name of the provider.

Definition at line 122 of file provider.cpp.

◆ domainsRegExp()

QString domainsRegExp ( ) const
Returns
A regular expression pattern which matches all the internet domains in which this type of account can be used.

Definition at line 168 of file provider.cpp.

◆ domDocument()

const QDomDocument domDocument ( ) const
Returns
The DOM of the whole XML provider file.

Definition at line 222 of file provider.cpp.

◆ hasTag()

bool hasTag ( const QString &  tag) const

Check if this provider has a tag.

Parameters
tagTag to look for
Returns
Provider has the tag?

Definition at line 188 of file provider.cpp.

References Provider::tags().

◆ iconName()

QString iconName ( ) const
Returns
The provider icon name.

Definition at line 159 of file provider.cpp.

◆ isSingleAccount()

bool isSingleAccount ( ) const
Returns
Whether the provider supports creating one account at most.

Definition at line 176 of file provider.cpp.

◆ isValid()

bool isValid ( ) const

Check whether this object represents a Provider.

Returns
true if the Provider is a valid one.

Definition at line 102 of file provider.cpp.

Referenced by Provider::name().

◆ name()

QString name ( ) const

Get the name of the provider.

This can be used as a unique identifier for this provider.

Returns
The unique name of the provider.

Definition at line 112 of file provider.cpp.

References Provider::isValid().

◆ pluginName()

QString pluginName ( ) const

Get the name of the account plugin associated with the provider.

Some platforms might find it useful to store plugin names in the provider XML files, especially when the same plugin can work for different providers.

Returns
The plugin name.

Definition at line 142 of file provider.cpp.

◆ tags()

QSet< QString > tags ( ) const

Return all tags of the provider as a set.

Returns
Set of tags

Definition at line 203 of file provider.cpp.

Referenced by Provider::hasTag().

◆ trCatalog()

QString trCatalog ( ) const
Returns
The name of the translation catalog, which can be used to translate the displayName().

Definition at line 151 of file provider.cpp.


The documentation for this class was generated from the following files: